LIB=./lib
INCLUDE=./include
SRC=./src
OBJ=./obj

#FLAGS= -g -Wall 
FLAGS=  -O3 -Wall

libmc920: $(LIB)/libmc920.a
	echo "libmc920.a built..."

$(LIB)/libmc920.a: \
$(OBJ)/common.o \
$(OBJ)/comptime.o \
$(OBJ)/image.o \
$(OBJ)/adjacency.o \
$(OBJ)/gqueue.o \
$(OBJ)/spectrum.o \

	ar csr $(LIB)/libmc920.a \
$(OBJ)/common.o \
$(OBJ)/comptime.o \
$(OBJ)/image.o \
$(OBJ)/adjacency.o \
$(OBJ)/gqueue.o \
$(OBJ)/spectrum.o \

$(OBJ)/common.o: $(SRC)/common.c
	gcc $(FLAGS) -c $(SRC)/common.c -I$(INCLUDE) \
	-o $(OBJ)/common.o 

$(OBJ)/comptime.o: $(SRC)/comptime.c
	gcc $(FLAGS) -c $(SRC)/comptime.c -I$(INCLUDE) \
	-o $(OBJ)/comptime.o 

$(OBJ)/image.o: $(SRC)/image.c
	gcc $(FLAGS) -c $(SRC)/image.c -I$(INCLUDE) \
	-o $(OBJ)/image.o 

$(OBJ)/adjacency.o: $(SRC)/adjacency.c
	gcc $(FLAGS) -c $(SRC)/adjacency.c -I$(INCLUDE) \
	-o $(OBJ)/adjacency.o 

$(OBJ)/gqueue.o: $(SRC)/gqueue.c
	gcc $(FLAGS) -c $(SRC)/gqueue.c -I$(INCLUDE) \
	-o $(OBJ)/gqueue.o 

$(OBJ)/spectrum.o: $(SRC)/spectrum.c
	gcc $(FLAGS) -c $(SRC)/spectrum.c -I$(INCLUDE) \
	-o $(OBJ)/spectrum.o 

clean: 
	rm $(LIB)/lib*.a; rm $(OBJ)/*.o; 	





